package com.example.sys.dao;

import com.example.sys.entity.Book;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
import org.springframework.data.rest.core.annotation.RestResource;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author ZhengDing
 * @date 2022/2/20 0:06
 */

//@Repository
//@RepositoryRestResource
//@RepositoryRestResource(path = "book", collectionResourceRel = "book", itemResourceRel = "bk")
public interface BookRepository extends JpaRepository<Book, Integer> {

    @RestResource(path = "province")
    List<Book> findAllByProvinceContains(@Param("province") String province);
}
